package com.pablito.service.exception;

public class UserException extends Exception {
    private static final long serialVersionUID = 4050482305178810162L;

    public UserException(final String message) {
        super(message);
    }
    
    public UserException(final UserExceptionCause cause) {
    	super(new Throwable(cause.getCode()));
    }
    
    public UserException(final String message, UserExceptionCause cause) {
        super(message, new Throwable(cause.getCode()));
    }
    
    public enum UserExceptionCause {
    	RENEW_CREDENTIALS_EXCEPTION("UEx001");
		
    	private String code;
		
    	private UserExceptionCause(String code) {
			this.code = code;
		}
    	
		public String getCode() {
			return code;
		}
    }
}
